<!-- <div class="row">
  <h1 translate lib="web">Mail history</h1>
</div> -->
<div class="col-sm-12 text-right">
  <em class="fas fa-cog fa-spin" ng-show="ctrl.loading==true"></em>
</div>
<div ng-show="ctrl.errormessage != ''"" class=" alert alert-danger" role="alert">{{ctrl.errormessage}}</div>
<table id="table1" class="table table-striped" when-scrolled="ctrl.more()" style="width: 100%;">
  <thead class="thead-dark">
    <tr>
      <th ng-click="ctrl.ToggleOrder('name')"><strong translate lib="web">name</strong></th>
      <th class="w-150" ng-click="ctrl.ToggleOrder('_created')"><strong translate lib="web">created</strong></th>
      <th class="w-150" ng-click="ctrl.ToggleOrder('_modified')"><strong translate lib="web">updated</strong></th>
      <th class="w-150" ng-click="ctrl.ToggleOrder('read')"><strong translate lib="web">readcount</strong></th>
      <th class="w-150"></th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat="model in ctrl.models">
      <td><a style="color: inherit; text-decoration: inherit;" ng-href="#/MailHist/{{model._id}}">{{model.name}}</a></td>
      <td>
        <timesince ng-model="model._created" />
      </td>
      <td>
        <timesince ng-model="model._modified" />
      </td>
      <td>{{model.readcount}}</td>
      <td class="btn-cell">
        <a ng-href="#/MailHist/{{model._id}}" class="btn"><em class="fas fa-eye"></em></a>        
        <a ng-href="#/Entity/users/{{model.userid}}" class="btn"><em class="fas fa-edit"></em></a>
      </td>
    </tr>
  </tbody>
</table>